#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <vector>
using namespace std;
class Solution
{
public:
    bool judgeCircle(string moves)
    {
        int cntx = 0, cnty = 0;
        if (moves.size() == 0)
            return true;
        for (auto &it : moves)
        {
            switch (it)
            {
            case 'U':
                cnty++;
                break;
            case 'D':
                cnty--;
                break;
            case 'L':
                cntx--;
                break;
            case 'R':
                cntx++;
                break;
            default:
                break;
            }
        }
        if (cntx == 0 && cnty == 0)
            return true;
        return false;
    }
};